const mutations = {
    ADD_TAGSLIST(state, object) {
        if (object && state.tagsList.some(item => item.path === object.path)) return;
        if(Array.isArray(object)) {
            state.tagsList = object;
        } else {
            state.tagsList.push(object);
        }
        localStorage.setItem("tagsList", JSON.stringify(state.tagsList));
    },
    DEL_TAGSLIST(state, index) {
        state.tagsList.splice(index, 1);
        localStorage.setItem("tagsList", JSON.stringify(state.tagsList));
    },
    SET_CURRENTACTIVE(state, path) {
        state.currentActive = path;
        localStorage.setItem("currentActive", path);
    },
    SET_CURRENTDATABASE(state, path){
        state.currentDatabase = path;
        localStorage.setItem("currentDatabase", path);
    }
}
export default mutations
